﻿using UnityEngine;
using UniRx;
using Cinemachine;
using UnityEngine.SceneManagement;
using Cysharp.Threading.Tasks;

public class CameraManager : GameFrameClassBase
{
    public static CinemachineVirtualCamera virtualCamera;
    private static Camera m_Camera;
    private static CinemachineConfiner m_Confiner;

    public override UniTask InitAsync()
    {
        virtualCamera = GameObject.FindObjectOfType<CinemachineVirtualCamera>();
        m_Confiner = virtualCamera.GetComponent<CinemachineConfiner>();
        m_Camera = GameObject.FindObjectOfType<Camera>();
        GameObject.DontDestroyOnLoad(virtualCamera.gameObject);
        GameObject.DontDestroyOnLoad(m_Camera.gameObject);

        // TODO 添加player获取方法
        return UniTask.CompletedTask;
    }
}